const BASE_URL="http://localhost:8888"
export const myRequest = (options)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url:BASE_URL+options.url,
			method:options.method || "GET",
			data:options.data || {},
			success: (res) => {
				console.log(res)
				if(res.statusCode != '200'){
					return uni.showToast({
					    title: '获取数据失败',
					    duration: 2000
					});
				}else{
					 resolve(res);
				}
			},
			fail:(err)=> {
				return uni.showToast({
				    title: '请求接口失败',
				    duration: 2000
				});	
				 reject(err);
			}
		})
	})
}
// myRequest({
// 	url:"/users/swiperImgList",
// 	method:"post",
// 	data:{
		
// 	}
// })